package com.openget.lang;

import java.util.Hashtable;
import java.util.Map.Entry;

public class TrapElement extends ElementModel implements IStrategyElement, IFatherElement {

	@Override
	public void implementation(OpengetContext context) {
		
		Hashtable<String, Object> returnValue = ElementLocator.getTrapables(this)[0].call(context, null);
		for (Entry<String, Object> entry : returnValue.entrySet())			
			context.getTrapped().put(entry.getKey(), entry.getValue());
		
		context.recycled();
	}
	
	@Override
	public ElementModel bastard(OpengetContext context) {
		return new PlaceholderElement(ElementLocator.getText(this));
	}
}
